package com.tsf;

import javax.swing.*;
import java.awt.*;

public class SticNoteUtil {

    public static ImageIcon getImageIcon(String filename, int size) {
        java.net.URL url = StickyNote.class.getResource(filename);
        if (url == null) return null;
        ImageIcon originalIcon = new ImageIcon(url);
        Image image = originalIcon.getImage();
        Image scaledImage = image.getScaledInstance(size, size, Image.SCALE_SMOOTH);
        return new ImageIcon(scaledImage);
    }
}
